﻿using System.Collections.Generic;
using Marqdown;
using Marqdown.PostProcessing;
using NUnit.Framework;

namespace MarkdownSharpTests
{
    [TestFixture]
    class TestPostProcessor
    {
        private PostProcessor _m;

        [SetUp]
        public void SetUp()
        {
            _m = new PostProcessor(new Dictionary<string, LinkItem>());
        }
        protected string Transform(string input)
        {
            var list = new List<string>();
            list.Add(input);
            _m.postProcess(list);
            Assert.AreEqual(1, list.Count);
            return list[0];
        }
        [Test]
        public void BackSlash()
        {
            string input = @"\#";
            string expected = "#";

            string actual = Transform(input);
            Assert.AreEqual(expected, actual);
        }

        [Test]
        public void BackTick()
        {
            string input = "Backtick creates the `code` tag";
            string expected = "Backtick creates the <code>code</code> tag";

            string actual = Transform(input);

            Assert.AreEqual(expected, actual);
        }

        [Test]
        public void Italic()
        {
            string input = "This is *italic*. This is also _italic_.";
            string expected = "This is <em>italic</em>. This is also <em>italic</em>.";

            string actual = Transform(input);

            Assert.AreEqual(expected, actual);
        }

    }
}

